<%= form_remote_tag :url=>{:action => 'create_incumbent'},:loading => "Element.show('uploading')"%>
<h2 style="clear: both;">所在公司信息</h2>
<table width="680" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td colspan="3" class="dot_dash">&nbsp;</td>
	</tr>
	<tr>
		<td height="32" class="maintext" width="100">
		<li>所在行业：</li>
		</td>
		<td height="32" colspan="2"><%= 
    @industries = Industry.find(:all).map {|u| [u.name, u.id] }
    select 'company', 'tindustry_id',@industries,:selected =>@industries[0] 
    %></td>
	</tr>
	<tr>
		<td height="32" class="maintext">
		<li>公司性质：</li>
		</td>
		<td height="32" colspan="2"><%= 
    @entities = Entity.find(:all).map {|u| [u.name, u.id] }
    select 'company', 'tentity_id',@entities ,:selected =>@entities[0]
    %></td>
	</tr>
	<tr>
		<td height="32" class="maintext">
		<li>公司名称：</li>
		</td>
		<td height="32" width="260"><%= text_field 'company', 'name',:size=>"35" ,:autocomplete=>"off",:indicator => "/images/progress.gif",
                                        :onMouseOver=>"this.style.backgroundColor = '#E5F0FF';",
                                        :onMouseOut=>"this.style.backgroundColor = '';"%>
		<div class="auto_complete" id="company_name_auto_complete"></div>
		<input id="company_id" name="company_id" type="hidden" value=0 /><%=observe_field("company_id",:frequency => 0.5,
    				:update => "infoList",:loading => "Element.show('indicator')",:complete => "Element.hide('indicator')",
    				:url => {:controller=>"index",:action => "post_company_info"}) %>
		<%=observe_field("company_id",:frequency => 0.5,
    				:update => "rankList",
    				:url => {:controller=>"index",:action => "post_company_rank"}) %> <%=auto_complete_field ("company_name", :url => {:controller=>"index",:action => "post_company"},
    		:with=>"'company_name='+ $F('company_name') + '&company_tindustry_id=' + $F('company_tindustry_id')+'&company_tentity_id='+ $F('company_tentity_id')") %>
		</td>
		<td class="maintext" align="right" width="320" valign="center">
		<span style="width:20px;height:17px;"><div id='indicator' style="display:none"><%=image_tag("/images/progress.gif")%></div></span>
		(输入关键字，用鼠标选择列表公司或<%= link_to_remote ("创建新公司", :update=>"infoList", 
					:url=>{:controller=>"index",:action=>"post_company_info"},
					:complete=>"$('companyid').value=0;$('company_name').value=''")%>)
		</td>
	</tr>
</table>
<div id="infoList"></div>
</br>
<h2 style="clear: both;">提供职位数据</h2>
<table width="680" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td colspan="2" class="dot_dash">&nbsp;</td>
	</tr>
	<tr>
		<td width="100" height="32" class="maintext">
		<li>职位名称：</li>
		</td>
		<td width="580" height="32"><%= text_field 'incumbent', 'tname',:size=>"35" , 
                                        :onMouseOver=>"this.style.backgroundColor = '#E5F0FF';",
                                        :onMouseOut=>"this.style.backgroundColor = '';"%></td>
	</tr>
	<tr>
		<td height="32" class="maintext">
		<li>月均收入：</li>
		</td>
		<td height="32"><%= text_field 'incumbent', 'tsalary',:size=>"10" , 
                                        :onMouseOver=>"this.style.backgroundColor = '#E5F0FF';",
                                        :onMouseOut=>"this.style.backgroundColor = '';"%></td>
	</tr>
	<tr>
		<td height="32" class="maintext">
		<li>所属职能：</li>
		</td>
		<td height="32"><%= select 'function', 'id',Function.find(:all).map {|u| [u.name, u.id] },:include_blank => true%>
		<%= observe_field(:function_id,:frequency => 0.5,:update => "position",:url => {:controller=>"index",:action => "post_position"}) %>
		</td>
	</tr>
	<tr>
		<td height="32" class="maintext">
		<li>所属职位：</li>
		</td>
		<td height="32" class="maintext" id="position">请选择所属职能</td>
	</tr>
	<tr>
		<td height="32" class="maintext">
		<li>有效年份：</li>
		</td>
		<td height="32" class="maintext"><%= select 'incumbent', 'teffective_year',
    2000..2008 %>&nbsp;年</td>
	</tr>
	<tr>
		<td height="32" class="maintext">
		<li>所在城市：</li>
		</td>
		<td height="32"><%= 
                	@regions=Region.find(:all).map {|u| [u.name, u.id] }
                	select 'region', 'id',@regions,:include_blank => true%>
		<%= observe_field(:region_id,:frequency => 0.5,:update => "city",:url => {:controller=>"index",:action => "post_city"})%>
		<span id='city' class="maintext">请选择所在地区</span>
		</td>
	</tr>
	<tr>
		<td height="32" class="maintext">
		<li>所属级别：</li>
		</td>
		<td height="32" class="maintext">
		<div id="rankList">请输入一个有效的所在公司的内部级别。（整数型，数字越大，级别越高）</div>
		</td>
	</tr>
	<tr>
		<td height="32" class="maintext">
		<li>标签&nbsp;[<%= link_to_remote "?", :update => 'check',:url=>{:controller=>"index", :action => "post_tag_notice"}%>]&nbsp;：</li>
		</td>
		<td height="32" class="maintext">
		<%= text_field 'incumbent', 'search_tag',:size=>"35", 
        								:onMouseOver=>"this.style.backgroundColor = '#E5F0FF';",
                                        :onMouseOut=>"this.style.backgroundColor = '';"%>
                                        &nbsp;&nbsp;（使用空格分隔，可以让其他用户方便地找到这些信息）
		</td>
	</tr>
	<tr>
		<td colspan="2" id="check">&nbsp;</td>
	</tr>
</table>
<%= submit_tag "完 成",:class=>"btn_mouseout",
													:onmouseover=>"this.className='btn_mouseover'",
 													:onmouseout=>"this.className='btn_mouseout'",
 													:onmousedown=>"this.className='btn_mousedown'",
  													:onmouseup=>"this.className='btn_mouseup'"%>
&nbsp;(&nbsp;
<%=link_to "取消",:controller=>"information",:action=>"index"%>
&nbsp;)<span style="height:20px;float:right;color: #666;margin-right:10px"><span id='uploading' style="display:none">正在保存信息<%=image_tag("/images/upload.gif")%></span>
</span>
<%= end_form_tag %>
